#include<bits/stdc++.h>
using namespace std;
int n,r[114514],num[114514],ans;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    cin>>n;
    for(int i=1;i<=n;i++){
        int k;
        cin>>k;
        r[k]++;
    }
    for(int i=1;i<=100000;i++){
        num[i]=num[i-1]+r[i];
        ans=min(ans+r[i],num[i-1]);
    }
    cout<<n-ans;
    return 0;
}
